home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-24 | 14.8 KB | 339 lines | [TEXT/CCL ] |
- ;--------------------------------------------------------------------------
- ; (c) Copyright 1990 by University of Massachusetts. All rights reserved.
- ;
- ; This software was conceived, designed, and written by Dan Suthers
- ; while supported by the National Science Foundation under grant number
- ; MDR 8751362, and by a fellowship from Apple Computer, Inc., Cupertino,
- ; CA. Partial support was also received from the Office of Naval Research
- ; under a University Research Initiative Grant, contract N00014-86-K-0764.
- ; Mr. Suthers created this software under his own initiative while in an
- ; academic relationship with the University of Massachusetts. The above
- ; copyright notice was a condition placed by University lawyers on approval
- ; of distribution of this software by Apple Computer, and is not meant to
- ; imply that this software was created in an employment or "work for hire"
- ; relationship between the University and Mr. Suthers.
- ;
- ; Permission to use, modify, and distribute this software is granted subject
- ; to the following restrictions and understandings:
- ; 1. The file header, including this notice, shall be retained, and may be
- ; extended to include documentation of modifications to the software.
- ; 2. This material is for nonprofit educational and research purposes only.
- ; Users are requested, but not required, to inform Mr. Suthers of any
- ; noteworthy uses of this software.
- ; 3. Mr. Suthers and the University of Massachusetts make no warrantee or
- ; representation that the operation of this software will be error free,
- ; and are under no obligation to provide any services.
- ; 4. Any user of such software agrees to indemnify and hold harmless Mr.
- ; Suthers and the University of Massachusetts from all claims arising
- ; out of the use or misuse of this software, or arising out of any
- ; accident, injury, or damage whatsoever, and from all costs, counsel
- ; fees, and liabilities incurred in or about any such claim, action, or
- ; proceeding brought thereon.
- ; 5. All materials and reports developed as a consequence of the use of
- ; this software shall duly acknowledge such use, in accordance with
- ; the usual standards of acknowledging credit in academic research.
- ;
- ; I wish to acknowledge the generous support of Beverly Woolf, who obtained
- ; the above grants and encouraged me to pursue my own research interests in
- ; her lab. This work would not have been possible without the resources and
- ; stimulating environment of the Computer and Information Science department.
- ;
- ; Dan Suthers 24-Jun-90 22:06:53
- ;--------------------------------------------------------------------------
- #|
-
- INTRODUCTION
-
- This collection of LISP source files provides some intermediate level
- programming tools which may be of use to others in research and prototype
- development efforts.
-
- ---------
- THE FILES
- ---------
-
- This collection contains the following files, which should be placed in
- subdirectories as indicated:
-
- ccl;INTERFACE:
- Dialogue.lisp
- Grapher.lisp
- Grapher-Demo.lisp
- Hyper-Display.lisp
- Hyper-Display-Demo.lisp
-
- ccl;MODULES:DACTN:
- DACTN-Browser.lisp
- DACTN-Compile.lisp
- DACTN-Demo.lisp
- DACTNS.lisp
-
- ccl;MODULES:DNET:
- DNET-Analyze.lisp
- DNET-Browser.lisp
- DNET-Compile.lisp
- DNET-Doc.text
- DNET-Test.lisp
- DNET.lisp
-
- ccl;MODULES:HNET:
- HNET-Browser.lisp
- HNET-Compile.lisp
- HNET-Printer.lisp
- HNET-Test.lisp
- HNET.lisp
-
- ccl;MODULES:RULES:
- Rule-Back.lisp
- Rule-Browser.lisp
- Rule-Build.lisp
- Rule-Defs.lisp
- Rule-Demo.lisp
- Rule-Forward.lisp
- Rules.lisp
-
- ccl;MODULES:SM:
- SM-Compile.lisp
- SM-Doc.text
- SM-Test.lisp
- SM.lisp
- SMEDIT.lisp
-
- ccl;UTILITY:
- COMPARE.lisp
- CONTROL.lisp
- DEQUEUE.lisp
- MAPPINGS.lisp
- MATH.lisp
- MISC.lisp
- UTILITY.lisp
-
- ------------------
- TOOL FUNCTIONALITY
- ------------------
-
- DACTNS:
-
- Discourse ACTion Networks, which are simply a graphical means of expressing
- procedural control. Each network is defined by a set of nodes, where each
- node consists of an action and a set of arcs which are candidate ways to
- traverse out of the node. One node is designated the start node. DACTNs
- are represented using SM objects for Actions, Tests (on the arcs) and the
- graphs that contain them. A graphical editing interface is provided using
- the Grapher package.
-
- DNET:
-
- Simple discrimination net facility for storing list expressions, associating
- information with those expressions, and performing pattern matching retrieval.
- A discrimination net facility lets one do several things:
- - 'Uniquify' list expressions under EQ by allowing one to retrive a stored
- expression using an EQUAL expression as the key.
- - Associate properties with list expressions (using the above capability).
- - Ask whether a particular expression has been stored in a data base.
- - Retrieve expressions by pattern matching using variables in either the
- retrieval key or in the stored expressions.
- - Change contexts efficiently by changing the discrimination net in use.
- A discrimination net may be used to implement a simple data base, or to
- support more sophisticated systems for deductive retrieval, forward and
- backward chaining of rules, and/or truth maintenance. The present package
- attempts to be simple, general, and efficient by providing the most basic
- operations efficiently implemented without frills.
-
- HNET:
-
- HNET represents directed acyclic graphs, and provides efficient computation
- of hierarchy relations, eg. finding the immediate or transitive predecessors
- and successors of a node in the graph, and determining what the subsumption
- relation is between any two nodes. Each node has an associated object, the
- TERM. A term's predecessors are called 'superordinates', and its successors
- are 'subordinates'. Obviously, an intended application of HNET is to encode
- and test subsumption relations in term hierarchies.
-
- INTERFACE:
-
- DIALOGUE provides a uniform collection of pop-up dialogues, used heavily
- by interface code in the other modules.
-
- GRAPHER: draws directed node-and-link graphs. Supports a variety of graph
- node and layout styles. Nodes are mouse sensitive, and mouse actions can
- be defined. A generic grapher for SM objects (see below) is provided,
- which also serves as an example of its use. This grapher differs from
- most in that it tries to fit the entire graph into the window. (Most
- graphers layout the graph in as much virtual space as is needed, and then
- use a scrollable window which displays only part of the graph if the graph
- is too large to fit.) My justification is that this grapher was intended
- to be used with applications which are "intelligent" enough to select
- digestable quantities of information, rather than overwhelming the user
- with a huge graph. Navigation through the graph is done by selecting
- commands on dialog menus which move from one meaningful "view" to another.
-
- HYPER-DISPLAY: A Hyper-text like display and browsing interface. The
- application provides a hierarchically structured representation of
- some text, and command functions. Regions of text (possibly nested)
- have structures with pointers to application data structures associated
- with them. Hyper-Display displays the text in a specialized Fred window.
- When the user selects a range of the text with a mouse, Hyper-Display is
- able to determine the smallest structure in the hierarchy which encloses
- that region. When the user initiates a query on this selected region of
- text, the command function is called on the structure representing the
- selected region. For example, a command could be a request to define a
- term, and the function could replace the text in the window with a
- definition, preserving a pointer to the previous hyper-structure, so
- that another command can return to the original text if desired.
-
- RULES:
-
- A rule-based reasoner built on the pattern-matching facilities of DNET.
- Rules may be defined and edited as SM objects (see below) for convenience,
- then loaded into a DNET for use. Supports several forms of forward and
- backward chaining: forward from a single datum added to a data base;
- forward from all data which match in a data base; back chaining to retrieve
- or determine whether an expression is true; and back chaining which also
- constructs and returns the support tree which makes the expression true.
-
- SM:
-
- Common Lisp Structures are extended to include support for:
- - keeping track of structure types defined and of instances of them created;
- - creating, destroying, and printing instances and types;
- - recording and accessing information about the type and slots definitions;
- - reuse of structures of destroyed instances to reduce garbage collection;
- - saving to and reloading definitions and instances from files; and
- - re-representation of existing instances when a type is redefined.
- With the exception of indirect reference to structures through names, SM
- attempts to be compatible with syntax of DEFSTRUCT and related functions,
- and to provide at least as much functionality. Currently only the :include
- and :conc-name functionality of DEFSTRUCT are not supported.
-
- UTILITY:
- COMPARE - Alternate comparison functions (e.g. more lenient EQUAL).
- CONTROL - Additional control constructs, and a RANDOM-CHOICE function.
- DEQUEUE - Macros implementing Double Ended Queues.
- MAPPNGS - Macros for treating association lists as abstract mappings.
- MATH - Math utilities: averaging, interpolation, coordinate conversion.
- MISC - Miscellaneous utility functions that didn't fit well elsewhere.
- UTILITY - Programmer interface utilities (e.g. documentation access).
-
- --------
- COMMENTS
- --------
-
- Almost every MODULE uses several of the UTILITY files, and all
- interface files use DIALOGUE. SM is used by quite a few of the
- other tools.
-
- One can load all of the above files by evaluating the expressions at
- the end of this present file. It is highly recommended that you place
- the above directories on *module-search-path*. The files SHOULD BE
- COMPILED. This will greatly reduce load time, and reduce the amount
- of memory required.
-
- Documentation, when available, is in the preamble of the relevant
- files. External functions and symbols are also well documented.
- (SM and DNET have separate documentation files.) Some tools have
- demo files, and files for compiling and testing the code.
-
- The code is well tested for MACL 1.3.2. Most of it will work in
- earlier versions of Allegro Common Lisp. The exceptions are due to
- non-upward-compatible changes, e.g. window-draw-contents ->
- window-draw-view, which only affects interface code such as the Grapher.
- Non-interface files are portable across any implementation of Common
- Lisp, and many have been tested on several (TI Explorer, VAX lisp,
- and HP lisp).
-
- These tools were developed by myself during the course of my Ph.D. research.
- However, the enclosed are not representative of the nature of that research.
- My research is in Artificial Intelligence, and is concerned with explanation
- as a knowledge communication activity. I am examining how interactive
- explanations in physical science domains make use of multiple perspectives
- on a topic, including choice of knowledge type, alternate granularities and
- ontologies, and the use of simplifications. My theory attempts to account
- for how an explainer balances adequacy and comprehensibility goals in making
- these choices, and does so in an interactive dialogue in which participants
- construct and refine a mutual model of the topic. One of my goals is to
- develop the technology to support computer-based knowledge communication
- systems (explainable expert systems, tutoring systems, etc.) which have some
- of these capabilities. However, you won't see any of that here.
-
- I welcome carefully thought out written comments and bug reports, but cannot
- respond to an onslaught of requests. Hence I have not provided my email
- address or phone number.
-
- -- Dan Suthers
- Computer and Information Science
- Lederle Graduate Research Center
- University of Massachusetts
- Amherst, MA 01003
-
- |#
-
- ;;; LOADING. This just loads the basic code and interfaces.
- ;;; (Some modules also have files for demos, testing the code
- ;;; after changes, compiling and testing, and documentation.
- ;;; Only the demos are loaded here.)
- ;;; I list what modules each module requires directly; other
- ;;; may be required indirectly. Comment out what you don't
- ;;; want, but be careful to respect REQUIRE dependencies.
-
- (let ((*load-verbose* t) ; so you can see what loads.
- (*save-fred-window-positions* nil)) ; so it will fit small screens.
-
- ;; Utilities, all stand-alone.
- (require :COMPARE "ccl;utility:compare")
- (require :CONTROL "ccl;utility:control")
- (require :DEQUEUE "ccl;utility:dequeue")
- (require :MAPPINGS "ccl;utility:mappings")
- (require :MATH "ccl;utility:math")
- (require :MISC "ccl;utility:misc")
- (require :UTILITY "ccl;utility:utility")
-
- ;; Stand-alone.
- (require :DIALOGUE "ccl;interface:dialogue")
-
- ;; Requires Dialogue.
- (require :HYPER-DISPLAY "ccl;interface:hyper-Display")
- (load "ccl;interface:Hyper-Display-Demo")
-
- ;; Stand-alone.
- (require :SM "ccl;modules:sm:sm")
- ;; Requires SM, Dialogue, Misc.
- (require :SMEDIT "ccl;modules:sm:smedit")
- (oneof *fred-window* :filename "ccl;modules:sm:sm-doc.text")
-
- ;; Requires SM, SMEDIT, Dialogue, Control, Mappings, Math, and Misc.
- (require :GRAPHER "ccl;interface:grapher")
- (load "ccl;interface:grapher-demo")
-
- ;; Requires SM.
- (require :HNET "ccl;modules:hnet:hnet")
- ;; Requires HNET, DIALOGUE, SM, SMEDIT, Grapher, Misc.
- (require :HNET-BROWSER "ccl;modules:hnet:hnet-browser")
-
- ;; Requires SM.
- (require :DACTNS "ccl;modules:dactn:dactns")
- ;; Requires DACTNS, SM, SMEDIT, DIALOGUE, GRAPHER, MISC
- (require :DACTN-BROWSER "ccl;modules:dactn:dactn-browser")
- (load "ccl;modules:dactn:dactn-demo")
-
- ;; Requires SM and Mappings.
- (require :DNET "ccl;modules:dnet:dnet")
- ;; Requires SM, SMEDIT, DNET, Dialogue.
- (require :DNET-BROWSER "ccl;modules:dnet:dnet-browser")
- (oneof *fred-window* :filename "ccl;modules:dnet:dnet-doc.text")
-
- ;; Requires SM, SMEDIT, DIALOGUE, DNET, DNET-Browser, GRAPHER,
- ;; Misc, Mappings. Loads all the following submodules, some
- ;; of which can be omitted (see files themselves for dependencies).
- (require :RULES "ccl;modules:rules:rules")
- (load "ccl;modules:rules:rule-demo")
- ;; (require :rule-defs "ccl;modules:rules:rule-defs")
- ;; (require :rule-build "ccl;modules:rules:rule-build")
- ;; (require :rule-browser "ccl;modules:rules:rule-browser")
- ;; (require :rule-forward "ccl;modules:rules:rule-forward")
- ;; (require :rule-back "ccl;modules:rules:rule-back")
-
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; The End.